import Vue from "vue";
import VueRouter from "vue-router";
import layout from '../views/layout/Index.vue'
// 首页
import Home from "@/views/home/index.vue";
// 综合态势
import ComprehensiveSituation from "@/views/ComprehensiveSituation/index.vue";
// 厂区漫游
import Factory from "@/views/Factory/index.vue";
Vue.use(VueRouter);

// //路由信息 哪个属性key看到  this.$route.matched=[{一级路由信息},{二级路由信息},...{当前路由信息}] 
const routes = [{
  path: '/',
  component: layout,
  children: [{
      path: "/home",
      name: "home",
      component: Home,
      meta: {
        title: '首页'
      },
    },
    {
      path: "/",
      name: "ComprehensiveSituation",
      component: ComprehensiveSituation,
      meta: {
        title: '综合态势'
      },
    },
    {
      path: "/Factory",
      name: "Factory",
      component: Factory,
      meta: {
        title: '厂区漫游'
      },
    },
  ]
}, 
// {
//   path: '*',
//   redirect: '/'
// }
];


const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});



export default router;